/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 *
 */

import { ComponentPath } from '@ohos/sdkmanager-common/build/src/core/constants/component-contants.js';

import { ProjectBuildProfile } from '../options/build/project-build-profile.js';

import { ArkUIXSdkInfo } from './info/arkuix-sdk-info.js';
import { Property } from './lib/property-get.js';
import ApiMeta = ProjectBuildProfile.ApiMeta;

/**
 * 扩展SDK
 *
 * @since 2023/05/18
 */
export class SdkInfoExtension {
  private readonly sdkVersion: ApiMeta;
  private sdkInfo: ArkUIXSdkInfo | undefined;
  private property: Property = new Property(false);

  constructor(sdkVersion: ApiMeta) {
    this.sdkVersion = sdkVersion;
  }

  getArkUIXInfo(): ArkUIXSdkInfo {
    return (this.sdkInfo = new ArkUIXSdkInfo([ComponentPath.ARKUI_X], this.sdkVersion, this.getArkUIXSdkDir()));
  }

  private getArkUIXSdkDir(): string {
    return this.property.getArkUIXSdkDir();
  }
}
